cmake_minimum_required(VERSION 3.16)
project(render VERSION 1.0 LANGUAGES C CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Set up AUTOMOC and some sensible defaults for runtime execution
# When using Qt 6.3, you can replace the code block below with
# qt_standard_project_setup()
set(CMAKE_AUTOMOC ON)
include(GNUInstallDirs)

find_package(QT NAMES Qt5 Qt6 REQUIRED COMPONENTS Core)


if(QT_FEATURE_private_tests)
    add_subdirectory(entity)
    add_subdirectory(renderpass)
    add_subdirectory(qgraphicsutils)
    add_subdirectory(shader)
    add_subdirectory(shaderbuilder)
    add_subdirectory(texture)
    add_subdirectory(material)
    add_subdirectory(vsyncframeadvanceservice)
    add_subdirectory(meshfunctors)
    add_subdirectory(qattribute)
    add_subdirectory(qbuffer)
    add_subdirectory(qgeometry)
    add_subdirectory(qgeometryrenderer)
    add_subdirectory(qlevelofdetail)
    add_subdirectory(levelofdetail)
    add_subdirectory(buffer)
    add_subdirectory(attribute)
    add_subdirectory(geometry)
    add_subdirectory(geometryrenderer)
    add_subdirectory(qcameraselector)
    add_subdirectory(qclearbuffers)
    add_subdirectory(qframegraphnode)
    add_subdirectory(qlayerfilter)
    add_subdirectory(qabstractlight)
    add_subdirectory(qenvironmentlight)
    add_subdirectory(qrenderpassfilter)
    add_subdirectory(qrenderstate)
    add_subdirectory(qrendertargetselector)
    add_subdirectory(qsortpolicy)
    add_subdirectory(qrenderstateset)
    add_subdirectory(qtechniquefilter)
    add_subdirectory(qtextureimagedata)
    add_subdirectory(qviewport)
    add_subdirectory(framegraphnode)
    add_subdirectory(qobjectpicker)
    add_subdirectory(objectpicker)
endif()
if(QT_FEATURE_private_tests AND NOT QT_FEATURE_qt3d_simd_avx2)
    add_subdirectory(qray3d)
    add_subdirectory(raycasting)
    add_subdirectory(trianglesextractor)
    add_subdirectory(triangleboundingvolume)
endif()
if(QT_FEATURE_private_tests AND QT_FEATURE_qt3d_opengl_renderer)
    add_subdirectory(filtercompatibletechniquejob)
    add_subdirectory(graphicshelpergl3_3)
    add_subdirectory(graphicshelpergl3_2)
    add_subdirectory(graphicshelpergl2)
    add_subdirectory(materialparametergathererjob)
    add_subdirectory(textures)
    add_subdirectory(renderer)
    add_subdirectory(renderviewutils)
    add_subdirectory(renderviews)
    add_subdirectory(renderqueue)
    add_subdirectory(renderviewbuilder)
    add_subdirectory(sendrendercapturejob)
endif()
if(QT_FEATURE_private_tests AND QT_FEATURE_qt3d_extras AND QT_FEATURE_qt3d_opengl_renderer)
    add_subdirectory(qmaterial)
    add_subdirectory(geometryloaders)
    add_subdirectory(picking)
    add_subdirectory(boundingsphere)
    add_subdirectory(qdefaultmeshes)
    add_subdirectory(pickboundingvolumejob)
    add_subdirectory(gltfplugins)
    add_subdirectory(updatemeshtrianglelistjob)
    add_subdirectory(updateshaderdatatransformjob)
endif()
if(QT_FEATURE_private_tests AND QT_FEATURE_qt3d_input AND QT_FEATURE_qt3d_opengl_renderer)
    add_subdirectory(qscene2d)
    add_subdirectory(scene2d)
endif()
if(QT_FEATURE_private_tests AND QT_FEATURE_qt3d_opengl_renderer AND NOT MACOS)
    add_subdirectory(graphicshelpergl4)
endif()
if(QT_FEATURE_private_tests AND QT_FEATURE_qt3d_opengl_renderer AND QT_FEATURE_qt3d_simd_avx2)
    add_subdirectory(alignedresourcesmanagers-avx)
endif()
if(QT_FEATURE_private_tests AND QT_FEATURE_qt3d_opengl_renderer AND QT_FEATURE_qt3d_simd_sse2)
    add_subdirectory(alignedresourcesmanagers-sse)
endif()
